#ifndef __DSTH_TIMER_H__
#define __DSTH_TIMER_H__

#include "TimerId.h"

namespace dsth {
class EventLoop;
class Timer {
public:
    Timer(const TimerCallBack& callback, uint64_t duetime, uint64_t period, 
        HANDLE timerQueue, EventLoop* loop);
    ~Timer();
    HANDLE GetTimerHandle() const { return timer_; }
    void RunTimerCallBack() { callback_(); }
private:
    TimerCallBack callback_;
    HANDLE timer_;
    EventLoop* loop_;
    static VOID CALLBACK TimerRoutine(PVOID param, BOOLEAN /*TimerOrWaitFired*/);
};

} // namespace
#endif // __DSTH_TIMER_H__
